set w = get_previous_instance( the WindowList, the windowName of me )
-- dispose of window if already open
if objectP( w ) then
forget w
end if
-- initialize from behavior parameters
if the windowName of me <> EMPTY then
set w = window the windowName of me
set the titleVisible of w = TRUE
else
set w = window "temp"
set the titleVisible of w = FALSE
end if
set the fileName of w = get_filename( the windowMovie of me )
set the windowType of w = get_window_style( me )
set the rect of w = rect( the windowLeft of me, the windowTop of me, ( the windowLeft of me + the windowWidth of me ), ( the windowTop of me + the windowHeight of me ))
open w
end
---
on get_previous_instance w_list, w_name
repeat with i = count( w_list ) down to 1
set w = getAt( w_list, i )
if the name of w = w_name then
return( w )
end if
end repeat
return( -1 )
end
on get_window_style me
case ( the windowType of me ) of:
#Document:
if the zoomable of me then
if the sizable of me then
set t = 8
else
set t = 12
end if
else -- NOT zoomable
if the sizable of me then
set t = 0
else
set t = 4
end if
end if
#Palette:
set t = 49
#Rounded:
set t = 16
#Plain:
set t = 2
#Shadow:
set t = 3
#"Modal Dialog":
set t = 1
#"Movable Modal Dialog":
set t = 5
otherwise: set t = 4
end case
return( t )
end
on get_filename f_name
-- don't force user to remember the extension
if NOT ( f_name contains ".dir" ) then
set f_name = f_name & ".dir"
end if
-- support relative pathnames
if (( f_name contains "/" ) OR ( f_name contains "\" )) then
return "Opens a Director movie in a window of the designated type. This behavior can be triggered by a specified event or by receiving the initOpenMIAW message. If width and height parameters are set to 0 (the default), the movie opens at it's original size." & RETURN & "PARAMETERS:" & RETURN & "ò Movie Name - Enter the file name of the movie to be opened." & RETURN & "ò Window Name - ( optional ) Enter the label to be displayed in window header, when visible." & RETURN & "ò Window Style - Choose a border style and interactivity options. The choices are: Document (moveable, sizeable window without a zoom box), Palette (floating palette), Rounded (rounded corners), Plain (plain box, no title bar), Shadowed (plain box with shadow, no title bar), Modal Dialog, and Moveable Modal Dialog " & RETURN & "ò Resize Box - Turn this option on to make the window resizable when appropriate." & RETURN & "ò Left, Top - Enter the initial offset ( in pixels ) of the window from the upper left corner of the display." & RETURN & "ò Width, Height - ( optional ) Enter the initial dimensions ( in pixels ) of the window." & RETURN & "ò Zoom Box - Turn this option on to add a minimize/maximize button to the title bar when appropriate." & RETURN & "ò Initializing Event - Choose the event that triggers the behavior. Choose initOpenMIAW to make the behavior run when it receives this message."